<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>ViewportTextureNode - Three.js Docs</title>
	<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
	<script src="../scripts/highlight.min.js"></script>
	<link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
	<link type="text/css" rel="stylesheet" href="../styles/page.css">
</head>
<body>
		<p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Node.html">Node</a> → <a href="InputNode.html">InputNode</a> → <a href="UniformNode.html">UniformNode</a> → <a href="TextureNode.html">TextureNode</a> → </p>
	<h1 translate="no">ViewportTextureNode</h1>
		<section>
			<header>
				<div class="class-description"><p>A special type of texture node which represents the data of the current viewport
as a texture. The module extracts data from the current bound framebuffer with
a copy operation so no extra render pass is required to produce the texture data
(which is good for performance). <code>ViewportTextureNode</code> can be used as an input for a
variety of effects like refractive or transmissive materials.</p></div>
			</header>
			<article>
				<div class="container-overview">
					<h2>Constructor</h2>
					<h3 class="name name-method" id="ViewportTextureNode" translate="no">new <a href="#ViewportTextureNode">ViewportTextureNode</a><span class="signature">( uvNode : <span class="param-type"><a href="Node.html">Node</a></span>, levelNode : <span class="param-type"><a href="Node.html">Node</a></span>, framebufferTexture : <span class="param-type"><a href="Texture.html">Texture</a></span> )</span> </h3>
					<div class="method">
						<div class="description">
							<p>Constructs a new viewport texture node.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>uvNode</strong>
									</td>
									<td class="description last">
										<p>The uv node.</p>
										<p>Default is <code>screenUV</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>levelNode</strong>
									</td>
									<td class="description last">
										<p>The level node.</p>
										<p>Default is <code>null</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>framebufferTexture</strong>
									</td>
									<td class="description last">
										<p>A framebuffer texture holding the viewport data. If not provided, a framebuffer texture is created automatically.</p>
										<p>Default is <code>null</code>.</p>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				<h2 class="subsection-title">Properties</h2>
				<div class="member">
					<h3 class="name" id="defaultFramebuffer" translate="no">.<a href="#defaultFramebuffer">defaultFramebuffer</a><span class="type-signature"> : <a href="FramebufferTexture.html">FramebufferTexture</a></span> </h3>
					<div class="description">
						<p>The reference framebuffer texture. This is used to store the framebuffer texture
for the current render target. If the render target changes, a new framebuffer texture
is created automatically.</p>
						<p>Default is <code>null</code>.</p>
					</div>
				</div>
				<div class="member">
					<h3 class="name" id="generateMipmaps" translate="no">.<a href="#generateMipmaps">generateMipmaps</a><span class="type-signature"> : boolean</span> </h3>
					<div class="description">
						<p>Whether to generate mipmaps or not.</p>
						<p>Default is <code>false</code>.</p>
					</div>
				</div>
				<div class="member">
					<h3 class="name" id="isOutputTextureNode" translate="no">.<a href="#isOutputTextureNode">isOutputTextureNode</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
					<div class="description">
						<p>This flag can be used for type testing.</p>
						<p>Default is <code>true</code>.</p>
					</div>
				</div>
				<div class="member">
					<h3 class="name" id="updateBeforeType" translate="no">.<a href="#updateBeforeType">updateBeforeType</a><span class="type-signature"> : string</span> </h3>
					<div class="description">
						<p>The <code>updateBeforeType</code> is set to <code>NodeUpdateType.FRAME</code> since the node renders the
scene once per frame in its <a href="ViewportTextureNode.html#updateBefore">ViewportTextureNode#updateBefore</a> method.</p>
						<p>Default is <code>'frame'</code>.</p>
					</div>
						<dl class="details">
							<dt class="tag-overrides"><strong>Overrides:</strong> <a href="TextureNode.html#updateBeforeType">TextureNode#updateBeforeType</a></dt>
						</dl>
				</div>
				<h2 class="subsection-title">Methods</h2>
					<h3 class="name name-method" id="getTextureForReference" translate="no">.<a href="#getTextureForReference">getTextureForReference</a><span class="signature">( reference : <span class="param-type"><a href="RenderTarget.html">RenderTarget</a></span> )</span><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
					<div class="method">
						<div class="description">
							<p>This methods returns a texture for the given render target reference.</p>
<p>To avoid rendering errors, <code>ViewportTextureNode</code> must use unique framebuffer textures
for different render contexts.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>reference</strong>
									</td>
									<td class="description last">
										<p>The render target reference.</p>
										<p>Default is <code>null</code>.</p>
									</td>
								</tr>
							</tbody>
						</table>
						<dl class="details">
							<dt class="tag-returns"><strong>Returns:</strong> The framebuffer texture.</dt>
						</dl>
					</div>
				<h2 class="subsection-title">Source</h2>
				<p>
					<a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/display/ViewportTextureNode.js" translate="no" target="_blank" rel="noopener">src/nodes/display/ViewportTextureNode.js</a>
				</p>
			</article>
		</section>
<script src="../scripts/linenumber.js"></script>
<script src="../scripts/page.js"></script>
</body>
</html>